





//
//  NDataInqueryViewController.m
//  nncloud
//
//  Created by macfai on 2018/12/20.
//  Copyright © 2018 macfai. All rights reserved.
//

#import "NDataInqueryViewController.h"
#import "NMineCell.h"
#import "NIndustryDataInqueryDetailVC.h"
#import "NCaiwuDataInqDetailVC.h"
@interface NDataInqueryViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,strong)UITableView *tableView;

@property (nonatomic,strong)NSMutableArray *dataArray;

@property (nonatomic,strong)NSArray *titleArray;

@end

@implementation NDataInqueryViewController

#define cellIdentifier  @"mineid"
#define HeaderHight  290
#define PageSize 20

-(UITableView *)tableView{
    
    if (!_tableView) {
        
        WeakStament(ws);
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0 , 0, ScreenWidth , ScreenHeight - 64) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.rowHeight = 80.f;
        //        _tableView.separatorColor = [UIColor clearColor];
        _tableView.backgroundColor = kBackgroundColor;
        [_tableView registerNib:[UINib nibWithNibName:@"NMineCell" bundle:nil] forCellReuseIdentifier:cellIdentifier];
        //        _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        //            [ws loadData];
        //        }];
        //        _tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        //            [ws loadMoreData];
        //        }];
        _tableView.showsVerticalScrollIndicator = NO;
        _tableView.tableFooterView = [UIView new];
        
    }
    return _tableView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = kWhiteColor;
    [self.navigationItem setItemWithTitle:@"数据查询" textColor:kNavigationTitleColor fontSize:18 itemType:center];
    
    self.titleArray = @[@"工业数据查询",@"财务数据查询",];
    self.dataArray = [NSMutableArray array];
    [self.view addSubview:self.tableView];
//    [self loadData];
    // Do any additional setup after loading the view from its nib.
}


///企业端

#pragma mark - delegate datasource

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//    NIndustyBaobiaoModel *model = self.dataArray[indexPath.row];
//    NTianBaoDetailViewController *detail = [NTianBaoDetailViewController new];
//    detail.hidesBottomBarWhenPushed = YES;
//    if (model.industryId) {
//        detail.baobiaoId = model.industryId;
//    }
//    detail.atitle = @"工业报表详情";
//
//    [self.navigationController pushViewController:detail animated:YES];
    if (indexPath.row==0) {
        NIndustryDataInqueryDetailVC *detail = [NIndustryDataInqueryDetailVC new];
        [self.navigationController pushViewController:detail animated:YES];
    }else{
        NCaiwuDataInqDetailVC *detail = [NCaiwuDataInqDetailVC new];
        [self.navigationController pushViewController:detail animated:YES];
    }
   
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.titleArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NMineCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
//    NIndustyBaobiaoModel *model = self.dataArray[indexPath.row];
    cell.LogoImage.image = WDImgName(self.titleArray[indexPath.row]);
    cell.nameLabel.text = self.titleArray[indexPath.row];
    return cell;
}


@end
